-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use rapids-logger to generate the cudf logger #17307
Conversation
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
/ok to test |
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is cudf/logger.hpp
?
It's defined in https://github.com/rapidsai/rapids-logger, specifically https://github.com/rapidsai/rapids-logger/blob/main/logger.hpp.in. We effectively have the same logger code copied into various RAPIDS libs (e.g. cuml has it too) so the idea is that we use CMake to generate project-specific loggers from a template. |
|
||
#include <dlfcn.h> | ||
#include <sys/stat.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this for functions like fstat
that we were previously getting via transitive includes from spdlog.
cpp/CMakeLists.txt
Outdated
# Define logging level | ||
target_compile_definitions(cudf PRIVATE "CUDF_LOG_ACTIVE_LEVEL=LIBCUDF_LOGGING_LEVEL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused as these are two separate env variables but seem to define the same thing? Can we combine them so we only have one env var for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LIBCUDF_LOGGING_LEVEL
is a CMake variable, while CUDF_LOG_ACTIVE_LEVEL
is a preprocessor definition (#define
in C/C++). They are independent entities that both need to exist since they serve different purposes. If you prefer, I can align the CMake variable's name with the underlying define, but that would be a breaking change for the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realize that LIBCUDF_LOGGING_LEVEL
is CMake variable but there is an env variable with the same name. So technically we have at least 3 logging variables. Probably my previous request to combine all of them into one is impossible. Maybe rename them to be something else better to understand? For example, can be like CUDF_COMPILE_LOG_LEVEL
(so we know it is used for compiling C++ code), and CUDF_ENV_LOG_LEVEL
so we know it is environment variable used at runtime etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My minor concern is I would like to have CUDF_LOG_ACTIVE_LEVEL
and LIBCUDF_LOGGING_LEVEL
combined into just one variable so we don't have to maintain both. This can be a future work. Otherwise this is great.
I tried to explain why they are different in the thread, but please let me know if that explanation isn't clear. They are fundamentally different types of variables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! With a question about follow-up work.
/merge |
5306eca
into
rapidsai:branch-25.02
## Description #17307 broke builds that use the rapids-cmake pinned dependencies feature since no version was specified for the rapids_logger dependency. This adds a version string equal to the git tag so the dependency has a stated version. ## Checklist - [X] I am familiar with the [Contributing Guidelines](https://github.com/rapidsai/cudf/blob/HEAD/CONTRIBUTING.md). - [ ] New or existing tests cover these changes. - [X] The documentation is up to date with these changes. --------- Co-authored-by: Nghia Truong <[email protected]> Co-authored-by: Vyas Ramasubramani <[email protected]> Co-authored-by: Bradley Dice <[email protected]>
Description
This PR replaces cudf's logger implementation with one generated using https://github.com/rapidsai/rapids-logger. This approach allows us to centralize the logger definition across different RAPIDS projects while allowing each project to vendor its own copy with a suitable set of macros and default logger objects. The common logger also takes care of handling the more complex packaging problems around ensuring that we fully isolate our spdlog dependency and do not leak any of its symbols, allowing our libraries to be safely installed in a much broader set of environments.
Contributes to rapidsai/build-planning#104.
Checklist